package com.littcore.saas.rest.system;

import java.util.List;
import java.util.Locale;

import javax.annotation.Resource;

import org.jsondoc.core.annotation.Api;
import org.jsondoc.core.annotation.ApiMethod;
import org.jsondoc.core.annotation.ApiQueryParam;
import org.jsondoc.core.annotation.ApiResponseObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.littcore.saap.system.service.IDictParamService;
import com.littcore.saap.system.vo.DictParamVo;

@Api(name = "数据字典服务", description = "查询数据字典，下拉框常用")
@Controller
public class DictparamServiceController {
    @Resource
    private IDictParamService dictParamService;
    
    @ApiMethod(description = "获取数据字典")
    @ApiResponseObject
    @RequestMapping
    @ResponseBody
    public  List<DictParamVo> getDictList(@ApiQueryParam(name = "dictType") @RequestParam(required=true) String dictType, @ApiQueryParam(name = "locale",description="支持en,zh_CN") @RequestParam(required=true) Locale locale)
    {
      List<DictParamVo> dictParamList = dictParamService.findByType(dictType, locale);
      return dictParamList;
    }
}
